-- GENERATED SPELL FOR [Qiraji Mindslayer] --


function spell0_15246(pUnit, Event) --@Cause Insanity,n/a--
pUnit:FullCastSpellOnTarget(26079,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15246', 10310, 1)
end

function spell1_15246(pUnit, Event) --@Mana Burn,Self--
pUnit:FullCastSpellOnTarget(26049,pUnit)
pUnit:RegisterEvent('Sorts_15246', 8287, 1)
end

function spell2_15246(pUnit, Event) --@Mind Blast,n/a--
pUnit:FullCastSpellOnTarget(26048,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15246', 1500, 1)
end

function spell3_15246(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(26044,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15246', 8000, 1)
end

function Sorts_15246(pUnit, Event)
local choix_sorts_15246 = math.random(0, 3)
if choix_sorts_15246 == 0 then
pUnit:RegisterEvent('spell0_15246', 1, 1)
end
if choix_sorts_15246 == 1 then
pUnit:RegisterEvent('spell1_15246', 1, 1)
end
if choix_sorts_15246 == 2 then
pUnit:RegisterEvent('spell2_15246', 1, 1)
end
if choix_sorts_15246 == 3 then
pUnit:RegisterEvent('spell3_15246', 1, 1)
end
end

function mob15246_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15246', math.random(1500, 3000), 1)
end

function mob15246_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15246_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15246_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15246, 1, 'mob15246_Action')
RegisterUnitEvent(15246, 2, 'mob15246_Leave')
RegisterUnitEvent(15246, 3, 'mob15246_Kill')
RegisterUnitEvent(15246, 4, 'mob15246_Die')
